import unittest


class TestForeach(unittest.TestCase):

    def test_for(self):
        for i in range(5):
            print(i)
        # 这个代码块只会被执行一次-即for循环的条件不满足时.
        else:
            print("此时的i", i)

    def test_while(self):
        a = 1
        while a < 7:
            print(a)
            a += 1
        # 同for循环的else一样, 这个代码块也是在while语句的循环条件不满足时执行.
        else:
            print(a, "不小于7")


if __name__ == '__main__':
    unittest.main()
